{extend name="default/base" /}
{block name="js"}
<script src="__STATIC__/plugins/echarts/echarts.min.js?v={$v}" type="text/javascript"></script>
<script>
// 销售统计
function saleCount(){
	$.post(WST.U('shop/reports/getStatSales'),WST.getParams('.ipt'),function(data,textStatus){
	    var json = WST.toJson(data);
	    var myChart = echarts.init(document.getElementById('saleMain'));
	    myChart.clear();
	    $('#mainTable').hide();
	    if(json.status=='1' && json.data){
			var option = {
			    tooltip : {
			        trigger: 'axis'
			    },
			    calculable : true,
			    xAxis : [
			        {
			            type : 'category',
			            data : json.data.days
			        }
			    ],
			    yAxis : [
			        {
			            type : 'value'
			        }
			    ],
			    series : [
			        {
			            name:'销售额',
			            type:'line',
			            data:json.data.dayVals
			        }
			    ]
			};
			myChart.setOption(option);
	    }
	}); 
}
</script>
{/block}
{block name="css"}
<link href="__SHOP__/css/main.css?v={$v}" rel="stylesheet">
{/block}
{block name="main"}
<!---->
<div class="wst-shop-info">
	<div class="wst-shop-na">
		<div class='wst-shop-name'><a target='_blank' href='{:Url("home/shops/index","shopId=".$data["shop"]["shopId"])}'>{$data['shop']['shopName']}</a></div>
		<span class="wst-shop-img">
	        <a target='_blank' href="{:url('home/shops/index',array('shopId'=>$data['shop']['shopId']))}">
	            <img src="__RESOURCE_PATH__/{:WSTImg($data['shop']['shopImg'])}" title="{$data['shop']['shopName']|WSTStripTags}" alt="{$data['shop']['shopName']|WSTStripTags}">
	        </a>
	    </span>
		<div class="wst-shop-na2">
		<span>认证等级：
		{volist name="$data['shop']['accreds']" id="sv"}
		<img src="__RESOURCE_PATH__/{$sv['accredImg']}">
		{/volist}
	    </span>
		<span class="wst-shop-na3">用户名：{$Think.session.tb_USER.loginName}</span>
		<span class="wst-shop-na3">上次登录：{:session('tb_USER.lastTime')}</span>
		<span class="wst-shop-na3">店铺地址：{:WSTMSubstr($data['shop']['shopAddress'],0,10)}</span>
		</div>
		
	</div>
	<div style="width: 30%;float: left;">
    <div class='wst-shop-name' style="margin-left: 20px;"><a>店铺评分</a></div>
	<div class="wst-shop-eva" style="margin-left: 8%">
		<p>商品评分</p>
		<div class="wst-shop-evai">
		{for start="0" end="$data['shop']['scores']['goodsScore']"}
			<img src="__STATIC__/plugins/raty/img/star-on.png">
		{/for}
		{for start="1" end="6-$data['shop']['scores']['goodsScore']"}
			<img src="__STATIC__/plugins/raty/img/star-off.png">
		{/for}
		</div>
	</div>
	<div class="wst-shop-eva">
		<p>时效评分</p>
		<div class="wst-shop-evai">
		{for start="0" end="$data['shop']['scores']['timeScore']"}
			<img src="__STATIC__/plugins/raty/img/star-on.png">
		{/for}
		{for start="1" end="6-$data['shop']['scores']['timeScore']"}
			<img src="__STATIC__/plugins/raty/img/star-off.png">
		{/for}
		</div>
	</div>
	<div class="wst-shop-eva">
		<p>服务评分</p>
		<div class="wst-shop-evai">
		{for start="0" end="$data['shop']['scores']['serviceScore']"}
			<img src="__STATIC__/plugins/raty/img/star-on.png">
		{/for}
		{for start="1" end="6-$data['shop']['scores']['serviceScore']"}
			<img src="__STATIC__/plugins/raty/img/star-off.png">
		{/for}
		</div>
	</div>
    </div>
	<div class="wst-shop-con">
		<div class='wst-shop-name' style="margin-left: 20px;"><a>平台联系方式</a></div>
		<p style="margin-left: 8%;"><span>电话：{$data['shop']['shopTel']}</span><span>QQ：{$data['shop']['shopQQ']}</span></p>
		<p style="margin-left: 8%;"><span>邮箱：{:WSTConf('CONF.serviceEmail')}</span><span>服务时间：{php}echo date("H:i",strtotime($data['shop']['serviceStartTime']));{/php}-{php}echo date("H:i",strtotime($data['shop']['serviceEndTime']));{/php}</span></p>
		<p></p>
	</div>
	<div class="f-clear"></div>
</div>


<div class="main">
	<div class="main_middle">
		<ul class="main_mid_box">
			<li class="mid_l">
				<div class="mid_l_item">
					<div class="main_title">
						<div class="wst-lfloat">
							
							<span class="c16_555">订单提示</span>
						</div>
						<div class="f-clear"></div>
					</div>
					<div class="mid_main">
						<ul class="order_info">
							{if WSTShopGrant('shop/ordercomplains/shopcomplain')}
							<li><a id="menuItem25" href="{:Url('shop/ordercomplains/shopcomplain')}" dataid="25">
								<div class="complain_num">{$data['stat']['complainNum']}</div>
								<div>待回应投诉</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/orders/delivered')}
							<li><a id="menuItem53" href="{:Url('shop/orders/delivered')}" dataid="53">
								<div class="complain_num">{$data['stat']['waitReceiveCnt']}</div>
								<div>待收货</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/orders/waitdelivery')}
							<li><a id="menuItem24" href="{:Url('shop/orders/waitdelivery')}" dataid="24">
								<div class="complain_num">{$data['stat']['waitDeliveryCnt']}</div>
								<div>待发货</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/orders/waituserpay')}
							<li><a id="menuItem55" href="{:Url('shop/orders/waituserpay')}" dataid="55">
								<div class="complain_num">{$data['stat']['orderNeedpayCnt']}</div>
								<div>待付款</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/orders/failure')}
							<li><a id="menuItem45" href="{:Url('shop/orders/failure')}" dataid="45">
								<div class="complain_num">{$data['stat']['cancel']}</div>
								<div>取消/拒收</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/orders/failure')}
							<li><a id="menuItem45" href="{:Url('shop/orders/failure')}" dataid="45">
								<div class="complain_num">{$data['stat']['orderRefundCnt']}</div>
								<div>待退款</div>
							</a></li>
							{/if}
						</ul>
					</div>
				</div>
                
				<div class="mid_l_item" style="margin-top:10px;">
					<div class="main_title">
						<div class="wst-lfloat">
							<span class="c16_555">商品信息</span>
						</div>
					</div>
					<div class="f-clear"></div>
					<div class="mid_main">
						<ul class="order_info">
							{if WSTShopGrant('shop/goods/store')}
							<li><a id="menuItem34" href="{:Url('shop/goods/store')}" dataid="34">
								<div class="complain_num">{$data['stat']['unSaleCnt']}</div>
								<div>仓库中</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/goods/stockwarnbypage')}
							<li><a id="menuItem54" href="{:Url('shop/goods/stockwarnbypage')}" dataid="54">
								<div class="complain_num">{$data['stat']['stockWarnCnt']}</div>
							    <div >预警库存</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/goods/sale')}
							<li><a id="menuItem32" href="{:Url('shop/goods/sale')}" dataid="32">
								<div class="complain_num">{$data['stat']['onSaleCnt']}</div>
								<div>出售中</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/goods/audit')}
							<li><a id="menuItem33" href="{:Url('shop/goods/audit')}" dataid="33">
								<div class="complain_num">{$data['stat']['waitAuditCnt']}</div>
								<div>待审核</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/goods/illegal')}
							<li><a id="menuItem56" href="{:Url('shop/goods/illegal')}" dataid="56">
								<div class="complain_num">{$data['stat']['illegalCnt']}</div>
							    <div>违规商品</div>
							</a></li>
							{/if}
							{if WSTShopGrant('shop/goodsconsult/shopReplyConsult')}
							<li><a id="menuItem102" href="{:Url('shop/goodsconsult/shopReplyConsult')}" dataid="102">
								<div class="complain_num">{$data['stat']['consult']}</div>
							    <div>待回复咨询</div>
							</a></li>
							{/if}
						</ul>
					</div>
				</div>
			</li>
			
			<li class="mid_r">
				
				<div class='mid_r_rbottom' style="margin-bottom: 10px;">
					<div class="main_title">
						<div class="wst-lfloat">
							
							<span class="c16_555">商家帮助</span>
						</div>
						<div class="f-clear"></div>
					</div>
					<div class="rbottom_main">
						<ul class="shop_tips">
							{wst:article cat="300" id="vo" num="8"}
							<li class="wst-textover"><a href="{:url('home/news/view',['id'=>$vo['articleId']])}" target="_blank"><i></i>{$key+1}、{$vo.articleTitle}</a><span>{:date('Y-m-d',strtotime($vo['createTime']))}</span></li>
							{/wst:article}
						</ul>
					</div>
				</div>
				<div class='mid_r_rbottom'>
					<div class="main_title">
						<div class="wst-lfloat">
							
							<span class="c16_555">商家公告</span>
						</div>
						<div class="f-clear"></div>
					</div>
					<div class="rbottom_main">
						<ul class="shop_tips2">
							{wst:article cat="51" id="vo" num="5"}
							<li class="wst-textover"><a href="{:url('home/news/view',['id'=>$vo['articleId']])}" target="_blank">{$key+1}、{$vo.articleTitle}</a><i>NEWS</i>&nbsp;&nbsp;&nbsp;&nbsp;<span>{:date('Y-m-d',strtotime($vo['createTime']))}</span></li>
							{/wst:article}
						</ul>
					</div>
				</div>
			</li>
			{if WSTShopGrant('shop/reports/topSaleGoods')}
			<li class="mid_c">
				<div class="index-right">
					<div class="index-right-item">
						<div class="main_title" style="padding-left:10px;">
							<div class="wst-lfloat">
								
								<span class="c16_555">最近30天销售排行</span>
							</div>
							<div class="f-clear"></div>
						</div>
						<ul class="right-list-tit">
							<li class="c12_555">序号</li>
							<li class="c12_555">商品</li>
							<li class="c12_555">数量</li>
						</ul>
						{volist name="$data['stat']['goodsTop']" id="glist" key="gkey" length="10"}
						<ul class="right-list-tit right-list">
							<li class="c14_ff66">
								<div class="gTop{$gkey} top-num">{$gkey}</div>
							</li>
							<li class="wst-textover"><a class="c14_ff90 atop{$gkey}" target="_blank" href="{:url('home/goods/detail',['goodsId'=>$glist.goodsId])}">{$glist.goodsName}</a></li>
							<li class="c14_ff66 gTop{$gkey}">{$glist.goodsNum?:0}</li>
						</ul>
						{/volist}

					</div>
				</div>
			</li>
			{/if}
			{if WSTShopGrant('shop/reports/statSales')}
			<li class="mid_r">
				<div class="sale_info">
					<div class="main_title">
						<div class="wst-lfloat">
							
							<span class="c16_555">近30天销售情况</span>
						</div>
						<div class="f-clear"></div>
					</div>
					<div id="saleMain" style="width:100%;height:335px;"></div>
				</div>
			</li>
			<script>$(function(){saleCount()});</script>
			{/if}
		</ul>
	</div>
<div class="f-clear"></div>
	
</div>


{/* 近30天 */}
<input type="hidden"  id="startDate"  class="ipt" value='{:date("Y-m-d",strtotime("-30 day"))}'/>
<input type="hidden" id="endDate" class="ipt" value='{:date("Y-m-d")}'/>
{/block}